﻿<%@ Page Title="Matrícula de Alunos" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="MatriculaAluno.aspx.cs" Inherits="AcadPosApp.ControlarMatricula.MatriculaAluno" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <style type="text/css">
        .style2
        {
            width: 303px;
        }
        .style3
        {
            width: 241px;
        }
        .style4
        {
            width: 442px;
        }
        .style6
        {
            height: 26px;
        }
        .style7
        {
            width: 241px;
            height: 26px;
        }
        .style9
        {
            width: 305px;
        }
        .style10
        {
            width: 313px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:Panel ID="pnlPesquisa" runat="server" GroupingText="Consulta de Alunos">
                <table class="form-inline">
                    <tr>
                        <td colspan="2">
                            <asp:Label ID="Label1" runat="server" Text="Estado"></asp:Label>
                            <br />
                            <asp:DropDownList ID="ddlEstadoPesquisa" runat="server" OnSelectedIndexChanged="ddlEstadoPesquisa_SelectedIndexChanged"
                                AutoPostBack="True" Width="150px">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td class="style2">
                            <asp:Label ID="Label2" runat="server" Text="Descrição"></asp:Label>
                            <br />
                            <asp:TextBox ID="TxtPesquisa" required pattern="[çÇùÙúÚôÔõÕòÒóÓìÌíÍêÊèÈéÉáÁàÀãÃâÂaA-zZ\s]+$"
                                title="Apenas Letras." runat="server" Width="300px" MaxLength="150"></asp:TextBox>
                        </td>
                        <td>
                            <br />
                            &nbsp;
                            <asp:Button ID="btnConsultar" runat="server" Text="Consultar" OnClick="btnConsultar_Click" />
                        </td>
                    </tr>
                </table>
                <br />
                <asp:GridView ID="gvwPesquisa" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                    CssClass="mGrid" DataKeyNames="MATRICULA,CPF" EmptyDataText="Dados não localizados..."
                    GridLines="Vertical" Width="45%" OnSelectedIndexChanged="gvwPesquisa_SelectedIndexChanged"
                    OnPageIndexChanging="gvwPesquisa_PageIndexChanging">
                    <AlternatingRowStyle BackColor="#D3D3D3" />
                    <Columns>
                        <asp:CommandField ButtonType="Image" SelectImageUrl="~/Imagens/select.png" ShowSelectButton="True" />
                        <asp:BoundField DataField="MATRICULA" HeaderText="Matrícula">
                            <ItemStyle HorizontalAlign="Center" Width="10%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="NOME" HeaderText="Nome">
                            <ItemStyle HorizontalAlign="Left" Width="60%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="ultima_solicitacao" HeaderText="Última Solic. Matrícula">
                            <ItemStyle HorizontalAlign="Left" Width="30%" />
                        </asp:BoundField>
                    </Columns>
                    <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                    <PagerStyle CssClass="pagination" ForeColor="Black" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#1E90FF" Font-Bold="True" ForeColor="White" />
                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                    <SortedAscendingHeaderStyle BackColor="#808080" />
                    <SortedDescendingCellStyle BackColor="#CAC9C9" />
                    <SortedDescendingHeaderStyle BackColor="#383838" />
                </asp:GridView>
                </asp:Panel>
            <br />
            <asp:Panel ID="pnlMatriculasAluno" runat="server" 
                GroupingText="Matrículas do Aluno" Visible="false">
                <asp:GridView ID="gvwMatriculasAluno" runat="server" AllowPaging="True" 
                    AutoGenerateColumns="False" CssClass="mGrid" 
                    DataKeyNames="ID_MATRICULA, MATRICULA,ID_TURMA" 
                    EmptyDataText="Dados não localizados..." GridLines="Vertical" 
                    OnPageIndexChanging="gvwMatriculasAluno_PageIndexChanging" 
                    OnRowCommand="gvwMatriculasAluno_RowCommand" 
                    OnRowCreated="gvwMatriculasAluno_RowCreated" 
                    OnRowDataBound="gvwMatriculasAluno_RowDataBound" 
                    OnSelectedIndexChanged="gvwMatriculasAluno_SelectedIndexChanged" 
                    Width="95%">
                    <AlternatingRowStyle BackColor="#D3D3D3" />
                    <Columns>
                        <asp:CommandField ButtonType="Image" SelectImageUrl="~/Imagens/select.png" 
                            ShowSelectButton="True" />
                        <%--<asp:TemplateField HeaderText="Editar" ShowHeader="False">
                        <ItemTemplate>
                            <abbr>
                                <asp:ImageButton ID="ImgAlterar" runat="server" CausesValidation="false" CommandName="Alterar"
                                    formnovalidate="formnovalidate" ImageUrl="~/Imagens/edit.png" Text="Alterar"
                                    Width="20px" />
                            </abbr>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" Width="1%" />
                        <ItemStyle HorizontalAlign="Center" Width="1%" />
                    </asp:TemplateField>--%>
                        <asp:TemplateField HeaderText="Excluir" ShowHeader="False">
                            <ItemTemplate>
                                <abbr title="Excluir">
                                <asp:ImageButton ID="Excluir" runat="server" CausesValidation="false" 
                                    CommandName="Excluir" formnovalidate="formnovalidate" 
                                    ImageUrl="~/Imagens/delete.png" 
                                    OnClientClick="return ShowConfirm('Tem certeza que deseja excluir?', this.ID);" 
                                    Text="Excluir" Width="20px" />
                                </abbr>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" Width="1%" />
                            <ItemStyle HorizontalAlign="Center" Width="1%" />
                        </asp:TemplateField>
                        <asp:BoundField DataField="ID_CURSO" HeaderText="Código">
                        <HeaderStyle HorizontalAlign="Center" Width="1%" />
                        <ItemStyle HorizontalAlign="Center" Width="1%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="NOME_CURSO" HeaderText="Curso">
                        <HeaderStyle HorizontalAlign="Center" Width="30%" />
                        <ItemStyle HorizontalAlign="Left" Width="30%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="CURRICULO" HeaderText="Currículo">
                        <HeaderStyle HorizontalAlign="Center" Width="10%" />
                        <ItemStyle HorizontalAlign="Center" Width="10%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="NOME_MODULO" HeaderText="Módulo">
                        <HeaderStyle HorizontalAlign="Center" Width="30%" />
                        <ItemStyle HorizontalAlign="Left" Width="30%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="COD_TURMA" HeaderText="Turma">
                        <HeaderStyle HorizontalAlign="Center" Width="10%" />
                        <ItemStyle HorizontalAlign="Center" Width="10%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="ESTADO" HeaderText="Estado">
                        <HeaderStyle HorizontalAlign="Center" Width="1%" />
                        <ItemStyle HorizontalAlign="Left" Width="1%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="NOME_POLO" HeaderText="Polo">
                        <HeaderStyle HorizontalAlign="Center" Width="10%" />
                        <ItemStyle HorizontalAlign="Left" Width="10%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="DATA_MATRICULA" HeaderText="Dt.Matrícula">
                        <HeaderStyle HorizontalAlign="Center" Width="30%" />
                        <ItemStyle HorizontalAlign="Left" Width="30%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="SITUACAO" HeaderText="Situação">
                        <HeaderStyle HorizontalAlign="Center" Width="10%" />
                        <ItemStyle HorizontalAlign="Left" Width="10%" />
                        </asp:BoundField>
                        <%--<asp:TemplateField HeaderText="Contrato" ShowHeader="False">
                        <ItemTemplate>
                            <abbr title="Relatório de Contrato">
                                <asp:ImageButton ID="ImgRelatorioContrato" runat="server" CausesValidation="false"
                                    CommandName="RelContrato" formnovalidate="formnovalidate" ImageUrl="~/Imagens/print.png"
                                    Text="RelContrato" Width="20px" />
                            </abbr>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" Width="1%" />
                        <ItemStyle HorizontalAlign="Center" Width="1%" />
                    </asp:TemplateField>--%>
                        <asp:TemplateField HeaderText="Contrato" ShowHeader="False">
                            <ItemTemplate>
                                <abbr title="Contrato">
                                <asp:ImageButton ID="Contrato" runat="server" CausesValidation="false" 
                                    CommandName="RelContrato" formnovalidate="formnovalidate" 
                                    ImageUrl="~/Imagens/print.png" Text="Excluir" Width="20px" />
                                </abbr>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" Width="1%" />
                            <ItemStyle HorizontalAlign="Center" Width="1%" />
                        </asp:TemplateField>
                        <%--<asp:TemplateField HeaderText="Dados Pessoais" ShowHeader="False">
                        <ItemTemplate>
                            <abbr title="Dados pessoais">
                                <asp:ImageButton ID="DadosPessoais" formnovalidate="formnovalidate" runat="server" CausesValidation="false"
                                    CommandName="RelDadosPessoais" ImageUrl="~/Imagens/print.png" Text="Excluir" Width="20px" />
                            </abbr>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" Width="10%" />
                        <ItemStyle HorizontalAlign="Center" Width="10%" />
                    </asp:TemplateField>--%>
                        <asp:TemplateField HeaderText="Comp. Matrícula" ShowHeader="False">
                            <ItemTemplate>
                                <abbr title="Comp. Matrícula">
                                <asp:ImageButton ID="CompMatricula" runat="server" CausesValidation="false" 
                                    CommandName="RelCompMatricula" formnovalidate="formnovalidate" 
                                    ImageUrl="~/Imagens/print.png" Text="" Width="20px" />
                                </abbr>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" Width="10%" />
                            <ItemStyle HorizontalAlign="Center" Width="10%" />
                        </asp:TemplateField>
                    </Columns>
                    <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                    <PagerStyle CssClass="pagination" ForeColor="Black" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#1E90FF" Font-Bold="True" ForeColor="White" />
                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                    <SortedAscendingHeaderStyle BackColor="#808080" />
                    <SortedDescendingCellStyle BackColor="#CAC9C9" />
                    <SortedDescendingHeaderStyle BackColor="#383838" />
                </asp:GridView>
                <asp:Panel ID="pnlOpcoesMatricula" runat="server" Visible="false">
                    <div class="legenda">
                        &nbsp;&nbsp;&nbsp;<asp:Button ID="btnSituacaoMatricula" runat="server" 
                            OnClick="btnSituacaoMatricula_Click" Text="Situação" Width="100px" />
                        &nbsp;<asp:Button ID="btnFinanceiroMatricula" runat="server" 
                            OnClick="btnFinanceiroMatricula_Click" Text="Financeiro" Width="100px" />
                        &nbsp;<asp:Button ID="btnHistórico" runat="server" OnClick="btnHistórico_Click" 
                            Text="Histórico" Width="100px" /><br /><br />
                            &nbsp;&nbsp;&nbsp;&nbsp;</div>
                    
                </asp:Panel>
                &nbsp;&nbsp;&nbsp;&nbsp;<asp:Button ID="btnMatricular" runat="server" 
                    formonvalidate="formonvalidate" OnClick="btnMatricular_Click" Text="Matricular" 
                    Visible="False" Width="100px" />
                <asp:Button ID="btnCancelar" runat="server" OnClick="btnCancelar_Click" 
                    Text="Cancelar" Visible="False" Width="100px" />
                <br /><br />
            </asp:Panel>
            <br />
            <asp:Panel ID="pnlCadastro" runat="server" GroupingText="Realizar Matrícula" Visible="False">
                <table class="form-inline">
                    <tr>
                        <td colspan="2">
                            Áreas de Conhecimento
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:DropDownList ID="ddlCadAreaConhecimento" runat="server" Width="300px" OnSelectedIndexChanged="ddlCadAreaConhecimento_SelectedIndexChanged"
                                AutoPostBack="True">
                            </asp:DropDownList>
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td class="style10">
                            Descrição
                        </td>
                        <td class="style12">
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td class="style10">
                            <asp:TextBox ID="txtCadDescricao" runat="server" MaxLength="250" Width="300px"
                                Enabled="False" required="required"></asp:TextBox>
                            <!-- <asp:RequiredFieldValidator ID="requiredCadPesquisa" runat="server" ControlToValidate="txtCadDescricao"
                                ErrorMessage="É necessário preencher o campo pesquisa!" ForeColor="Red" SetFocusOnError="True"
                                ValidationGroup="cadPesquisaCurso">*</asp:RequiredFieldValidator> -->
                        </td>
                        <td class="style12">
                            <asp:Button ID="btnConsultarCursoCad" runat="server" formnovalidate="formnovalidate"
                                Text="Consultar" ValidationGroup="cadPesquisaCurso" OnClick="btnConsultarCursoCad_Click" />
                        </td>
                        <td>
                            &nbsp;&nbsp;
                        </td>
                    </tr>
                </table>
                <asp:GridView ID="gvwCursoCadastro" runat="server" AutoGenerateColumns="False" CssClass="mGrid"
                    DataKeyNames="ID_CURSO" EmptyDataText="Dados não localizados..." GridLines="Vertical"
                    Width="45%" OnRowDataBound="gvwCursoCadastro_RowDataBound" AllowPaging="True"
                    OnPageIndexChanging="gvwCursoCadastro_PageIndexChanging" 
                    OnSelectedIndexChanged="gvwCursoCadastro_SelectedIndexChanged">
                    <AlternatingRowStyle BackColor="#D3D3D3" />
                    <Columns>
                        <asp:CommandField ButtonType="Image" SelectImageUrl="~/Imagens/select.png" ShowSelectButton="True">
                            <ItemStyle Width="1%" />
                        </asp:CommandField>
                        <asp:BoundField DataField="ID_CURSO" HeaderText="Código">
                            <HeaderStyle HorizontalAlign="Center" Width="1%" />
                            <ItemStyle HorizontalAlign="Center" Width="1%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="DESCRICAO" HeaderText="Cursos">
                            <ItemStyle HorizontalAlign="Left" Width="75%" />
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="Status">
                            <ItemTemplate>
                                <asp:Image ID="imgStatus" runat="server" Height="25px" Width="25px" />
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" Width="1%" />
                            <ItemStyle HorizontalAlign="Center" Width="1%" />
                        </asp:TemplateField>
                        <asp:BoundField DataField="SITUACAO" HeaderText="Situação">
                            <ItemStyle Width="10%" HorizontalAlign="Center" />
                        </asp:BoundField>
                    </Columns>
                    <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                    <PagerStyle CssClass="pagination" ForeColor="Black" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#1E90FF" Font-Bold="True" ForeColor="White" />
                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                    <SortedAscendingHeaderStyle BackColor="#808080" />
                    <SortedDescendingCellStyle BackColor="#CAC9C9" />
                    <SortedDescendingHeaderStyle BackColor="#383838" />
                </asp:GridView>
                <table class="form-inline">
                    <tr>
                        <td class="style6">
                            Currículo
                        </td>
                        <td class="style3">
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td class="style6">
                            <asp:DropDownList ID="ddlCadCurriculo" runat="server" Enabled="False" Width="300px"
                                OnSelectedIndexChanged="ddlCadCurriculo_SelectedIndexChanged" 
                                AutoPostBack="True">
                            </asp:DropDownList>
                        </td>
                        <td class="style7">
                            &nbsp;
                        </td>
                        <td class="style6">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td class="style6">
                            Módulo
                        </td>
                        <td class="style3">
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td class="style6">
                            <asp:DropDownList ID="ddlCadModulo" runat="server" Width="300px" Enabled="False"
                                OnSelectedIndexChanged="ddlCadModulo_SelectedIndexChanged">
                            </asp:DropDownList>
                        </td>
                        <td class="style3">
                            &nbsp;
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                </table>
                <table class="form-inline">
                    <tr>
                        <td class="style9">
                            Estado
                        </td>
                        <td class="style4">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td class="style9">
                            <asp:DropDownList ID="ddlCadEstado" runat="server" OnSelectedIndexChanged="ddlCadEstado_SelectedIndexChanged"
                                Width="150px" AutoPostBack="True">
                            </asp:DropDownList>
                        </td>
                        <td class="style4">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td class="style9">
                            Polo
                        </td>
                        <td class="style4">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td class="style9">
                            <asp:DropDownList ID="ddlCadPolo" runat="server" Enabled="False" Width="300px" AutoPostBack="True"
                                OnSelectedIndexChanged="ddlCadPolo_SelectedIndexChanged">
                            </asp:DropDownList>
                        </td>
                        <td class="style4">
                            <asp:Button ID="btnPesquisarTurmas" runat="server" Text="Pesquisar Turmas" OnClick="btnPesquisarTurmas_Click" />
                        </td>
                    </tr>
                </table>
                <asp:GridView ID="gvwPesquisaTurmas" runat="server" AutoGenerateColumns="False" CssClass="mGrid"
                    DataKeyNames="ID_TURMA, ID_CURRICULO, ID_POLO, ID_PROFISSIONAL" EmptyDataText="Dados não localizados..."
                    GridLines="Vertical" AllowPaging="True" OnPageIndexChanging="gvwPesquisaTurmas_PageIndexChanging"
                    Width="70%">
                    <AlternatingRowStyle BackColor="#D3D3D3" />
                    <Columns>
                        <asp:CommandField ButtonType="Image" SelectImageUrl="~/Imagens/select.png" ShowSelectButton="True">
                            <ItemStyle Width="1%" />
                        </asp:CommandField>
                        <asp:BoundField DataField="CURRICULO" HeaderText="Currículo">
                            <HeaderStyle HorizontalAlign="Center" Width="1%" />
                            <ItemStyle HorizontalAlign="Center" Width="1%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="DESCRICAO_MODULO" HeaderText="Módulo">
                            <HeaderStyle HorizontalAlign="Center" Width="3%" />
                            <ItemStyle HorizontalAlign="Left" Width="3%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="COD_TURMA" HeaderText="Turma">
                            <HeaderStyle HorizontalAlign="Center" Width="1%" />
                            <ItemStyle HorizontalAlign="Center" Width="1%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="QTD_PARCELAS" HeaderText="Qtde Parcelas">
                            <HeaderStyle HorizontalAlign="Center" Width="1%" />
                            <ItemStyle HorizontalAlign="Center" Width="1%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="VALOR" HeaderText="Valor" DataFormatString="{0:c}">
                            <HeaderStyle HorizontalAlign="Center" Width="1%" />
                            <ItemStyle HorizontalAlign="Center" Width="1%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="DATA_INICIO" HeaderText="Data Início">
                            <HeaderStyle HorizontalAlign="Center" Width="1%" />
                            <ItemStyle HorizontalAlign="Center" Width="1%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="DATA_FIM" HeaderText="Data Fim">
                            <HeaderStyle HorizontalAlign="Center" Width="1%" />
                            <ItemStyle HorizontalAlign="Center" Width="1%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="QTD_DISC" HeaderText="Qtde. Disc. Ministr.">
                            <HeaderStyle HorizontalAlign="Center" Width="1%" />
                            <ItemStyle HorizontalAlign="Center" Width="1%" />
                        </asp:BoundField>
                        <%--<asp:BoundField DataField="QTD_ALUNOS" HeaderText="Qtde.Alunos">
                    <HeaderStyle HorizontalAlign="Center" Width="1%" />
                    <ItemStyle HorizontalAlign="Center" Width="1%" />
                </asp:BoundField>--%>
                        <asp:BoundField DataField="NOME_PROFISSIONAL" HeaderText="Coordenador">
                            <HeaderStyle HorizontalAlign="Center" Width="1%" />
                            <ItemStyle HorizontalAlign="Center" Width="1%" />
                        </asp:BoundField>
                    </Columns>
                    <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                    <PagerStyle CssClass="pagination" ForeColor="Black" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#1E90FF" Font-Bold="True" ForeColor="White" />
                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                    <SortedAscendingHeaderStyle BackColor="#808080" />
                    <SortedDescendingCellStyle BackColor="#CAC9C9" />
                    <SortedDescendingHeaderStyle BackColor="#383838" />
                </asp:GridView>
                <br />
                <div class="legenda">
                    <asp:Button ID="btnConfirmar" runat="server" Text="Confirmar" ValidationGroup="cadastro"
                        OnClick="btnConfirmar_Click" Width="100px" />
                    &nbsp;<asp:Button ID="btnCancelarCadastro" formnovalidate="formnovalidate" runat="server"
                        Text="Cancelar" OnClick="btnCancelarCadastro_Click" Width="100px" />
                </div><br />
            </asp:Panel>
        </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID="gvwMatriculasAluno" />
        </Triggers>
    </asp:UpdatePanel>
    <asp:ValidationSummary ID="ValidationSummary3" runat="server" ShowMessageBox="True"
        ShowSummary="False" ValidationGroup="cadPesquisaCurso" />
</asp:Content>
